<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		
        <meta name="author" content="order by dede58.com"/>
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<title>收货地址</title>
		<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<link rel="stylesheet" type="text/css" href="css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/common.css" />
		<link rel="stylesheet" type="text/css" href="css/my.css">
		<script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="js/jquery.SuperSlide.2.1.js"></script>
		<script type="text/javascript" src="js/other.js"></script>
		<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
		<script type="text/javascript" src="js/my.js"></script>
		<script type="text/javascript" src="js/distpicker.data.js"></script>
		<script type="text/javascript" src="js/distpicker.js"></script>
		<script type="text/javascript" src="js/main.js"></script>
		
	</head>

	<body>
		<jsp:include page="title.jsp" flush="true" />
		<jsp:include page="navbar.jsp" flush="true" />

		<!--Main-wrap-->
		<div class="main-wrap graybg">
			<div class="wrapper pt40 pb40 clearfix">
				<div class="fl slide-nav white-box">
					<ul>
					<li>
							<a href="${pageContext.request.contextPath}/userSelectById" class="db fs16">个人信息</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/Auction/selectByUserId" class="db fs16">我的竞拍</a>
						</li>
						<li >
							<a href="${pageContext.request.contextPath}/Order/selectOrderByUser" class="db fs16">我的订单</a>
						</li>
						
						<li class="on">
							<a href="${pageContext.request.contextPath}/adressList" class="db fs16">收货地址</a>
						</li>
						
						
						<li>
							<a href="${pageContext.request.contextPath}/accountList" class="db fs16">账户余额</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/recharge" class="db fs16">在线充值</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/password" class="db fs16">修改密码</a>
						</li>						
					</ul>
				</div>
				<div class="fr slide-show white-box">
					<div class="dark-tit line-bot">
						<h3 class="fs26 ">收货地址</h3></div>
					<div class="add-address fs14 mt20 mb30" >
						<form action="adressAdd">
							<p class="address-tit mb20 clearfix "><i class="fl iconfont tc alertAdd" >&#xe611;</i><span class="fl fs16 bold orange ml5 closeAdd">新增收货地址</span></p>
							
							<div id="mask1" style="display: none">
							<div id="error"></div>
							<p class="mb20 clearfix">
								<label class="fl"><em class="red">*</em>收件人：</label>
								<input type="text" placeholder="姓名" name="adressName"  class="fl name6">
								<label class="fl"><em class="red">*</em>手机号：</label>
								<input type="text" placeholder="手机" name="adressPhone"  class="fl phone6">
							</p>
							
							
								<label class="fl"><em class="red f-arial">*</em>地址：</label>
								
								<div id="distpicker1">
  <select name="adressProvince" class="fl"></select>
  <select name="adressCity" class="fl ml10"></select>
  <select name="adressArea" class="fl ml10"></select>
</div>
								
							
							<p class="mb20 clearfix ">
								<label class="fl">&nbsp;</label>
								<textarea  cols="30" rows="10" placeholder="请输入您的详细地址" name="adressAdress" class="fl adress adress6"></textarea>
							</p>
							
							<p class="mb20 clearfix">
								<label class="fl">邮政编码：</label>
								<input type="text" placeholder="邮政编码" name="adressCode" class="fl code6">
							</p>
							<p class="mb20 clearfix">
								<label class="fl">&nbsp;</label>
								<input type="submit" value="确认" class="fl orange-but radius3 fs16 adressUpdate6">
								<input type="button" value="取消" class="fl reset-but radius3 fs16 ml10">
							</p>
							</div>
						</form>
					</div>
					<div class="saved-address">
						<p class="address-tit mb10 clearfix"><i class="fl iconfont tc">&#xe610;</i><span class="fl fs16 bold orange ml5">已保存收货地址</span></p>
						<table class="ye-table address-table" style="border:1px solid #eaeaea">
							<tr>
								<th width="10%">收货人</th>
								<th width="50%">收货地址</th>
								<th width="10%">电话</th>
								<th width="10%">邮编</th>
								<th width="20%">操作</th>
							</tr>
							
							
		<c:forEach items="${adressList}" var="c" varStatus="st">
        <tr>         
            <td>${c.adressName}</td>
            <td>${c.adressProvince}${c.adressCity}${c.adressArea}${c.adressAdress}</td>            
            <td>${c.adressPhone}</td>
            <td>${c.adressCode}</td>  
			<td><a href="adressDelete?adressId=${c.adressId}" class="pl10"><i class="iconfont">&#xe60b;</i><em class="orange">删除</em></a>
			<a onclick="queryAdressById(${c.adressId})" class="pl10 "><i class="iconfont closeUpdate">&#xe60f;</i><em class="orange ">编辑</em></a>
			</td>                     
        </tr>
    </c:forEach>														
						</table>
						
						<div class="user-info mt50 clearfix " id="edit-modal" style="display: none;" >
						
						<div id="edit-modal-body">									
				
				</div>
					</div>
						
					</div>

				</div>

			</div>
			
		</div>
		<!--/end-->
			
		<jsp:include page="foot.jsp" flush="true" />

	</body>

<script type="text/javascript">

	function queryAdressById(adressId) {
		$.ajax({
			url : "adressSelectById?adressId=" + adressId,
			dataType : "html",
			success : function(data) {				
				$("#edit-modal-body").html(data);
				$("#edit-modal").show();

			}
		})

	}	


</script>
<script type="text/javascript">
$("#distpicker1").distpicker();
</script>
</html>